package mo.leetcode_top;

import mo.common.ListNode;

public class LO22 {

    public ListNode getKthFromEnd(ListNode head, int k) {

        ListNode fast = head;
        while (k > 0) {
            fast = fast.next;
            k--;
        }

        while (fast != null) {
            head = head.next;
            fast = fast.next;
        }

        return head;
    }

}
